

package com.hazelcast.spi.impl.operationservice;

import com.hazelcast.internal.partition.MigrationEndpoint;
import com.hazelcast.internal.partition.PartitionMigrationEvent;

/**
 * SPI for blocking backup operations
 *
 * @see BlockingOperation
 * @see BackupOperation
 * @since 6.0
 */
public interface BlockingBackupOperation extends AsynchronouslyExecutingBackupOperation {

    /**
     * Informs {@link com.hazelcast.spi.impl.operationparker.OperationParker} if the operation is still
     * relevant after migration for given data structure. Usually this should check if the new replica
     * index contains backup data of the data structure.
     *
     * @param event migration event. This will always be event for {@link MigrationEndpoint#SOURCE}
     *              between 2 backup indexes
     * @return if the operation should be kept in the parking queue
     */
    boolean shouldKeepAfterMigration(PartitionMigrationEvent event);
}
